package com.cn.web;

import com.cn.entity.User;
import com.cn.service.UserService;
import com.cn.vo.ReJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by chenyuncong on 2018/9/13.
 */
@RestController
public class User2Controller {

    @Autowired
    private UserService userService;

    @RequestMapping("getList")
    public ReJson getList() throws Exception {
        ReJson reJson= new ReJson(0,null);
        List<User> list = userService.getList("select * from user",User.class);
        reJson.setData(list);
        return reJson;
    }

    public String save(){

        return "1";
    }

}
